package com.zyf.project.kvdb.protocol.proto.wal;

import com.zyf.project.binaryproto.annotation.DataContract;
import com.zyf.project.binaryproto.annotation.DataField;
import com.zyf.project.binaryproto.type.PrimitiveType;
import com.zyf.project.kvdb.protocol.constants.Constants;

/**
 * <h1>键值对</h1>
 *
 * @author Zhou Yifan
 */
@DataContract(code = Constants.WAL_KV)
public interface KV {

    /**
     * 获取键
     *
     * @return 字节数组
     */
    @DataField(order = 1, primitiveType = PrimitiveType.BYTES)
    byte[] getKey();

    /**
     * 获取值
     *
     * @return 字节数组
     */
    @DataField(order = 2, primitiveType = PrimitiveType.BYTES)
    byte[] getValue();

}
